package com.cdks.wuxiu.api.util;


import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;


public class SmsUtils
{
    public static void init(String env)
    {
    }

    public static void sendManageNotice(String content)
    {
        //发送短信通知
        JSONObject json  = new JSONObject();
        json.set("content", "[舞秀]" + content);
        HttpUtils.send_post_request("http://localhost:8183/sms/manage.php", null, JSONUtil.toJsonStr(json));
    }

    public static void sendManageNotice(String phone, String content)
    {
        //发送短信通知
        JSONObject json  = new JSONObject();
        json.set("phone", phone);
        json.set("content", "[舞秀]" + content);
        HttpUtils.send_post_request("http://localhost:8183/sms/manage.php", null, JSONUtil.toJsonStr(json));
    }

    public static void sendAuthCode(String phone, String code)
    {
        JSONObject json  = new JSONObject();
        json.set("phone", phone);
        json.set("smsCode", code);

        HttpUtils.send_post_request("http://localhost:8183/sms/authCode.php", null, JSONUtil.toJsonStr(json));
    }

    public static void sendCallNotice(String phone, int branch)
    {
        //发送短信通知
        JSONObject json  = new JSONObject();
        json.set("phone", phone);
        json.set("branch", branch);
        HttpUtils.send_post_request("http://localhost:8183/sms/call.php", null, JSONUtil.toJsonStr(json));
    }
}
